import Vue from 'vue'
import Vuex from 'vuex'
//@/ ->src 目录
import {getItem} from '@/utils/storage.js'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    userInfo: getItem("userInfo"),
    userRole: getItem("userRole"),
  },
  mutations: {
    userInfoMutation(state,payload) {
      // 更改userInfo值
      state.userInfo = payload
    },
    userRoleMutation(state, payload){
      state.userInfo = payload
    }
  },
  actions: {
  },
  modules: {
  }
})
